package com.definity.toolkit.web.taglib;

import javax.servlet.jsp.JspException;

import com.definity.toolkit.domain.DynamicDomain;

public class DynamicTag extends BaseTag {

	private static final long serialVersionUID = 7798008384325278847L;

	private DynamicDomain<?> domain; 
	private String property;
	
	public DynamicTag() {

	}

	public void setDomain(DynamicDomain<?> domain) {
		this.domain = domain;
	}
	
	public void setProperty(String property) {
		this.property = property;
	}
	
	@Override
	public int doEndTag() throws JspException {
		write(String.valueOf(domain.getProperty(property)));
		return super.doEndTag();
	}
	
}
